
//scroll() 方法为滚动事件  
$(window).scroll(function () {
  if ($(window).scrollTop() > 50) {
    $(".scrollTop").addClass("active");
  } else {
    $(".scrollTop").removeClass("active");
  }
});
$(".scrollTop").click(function () {

  $('body,html').animate({
    scrollTop: 0
  }, 300);

  return false;

});


//菜单点击事件


// 首页banner轮播
var bannerSwiper = new Swiper('.banner .swiper-container', {
  speed: 2000,
  autoplay: {
    delay: 2400,
    disableOnInteraction: false,
  },
  loop: true,
  observer: true, //修改swiper自己或子元素时，自动初始化swiper 
  observeParents: true, //修改swiper的父元素时，自动初始化swiper 
  watchOverflow: true,
  navigation: {
    nextEl: '.banner .swiper-button-next',
    prevEl: '.banner .swiper-button-prev',
  },
  pagination: {
    el: '.banner .swiper-pagination',
    clickable: true,
  },
});

// 中心服务

var featureSwiper = new Swiper('.feature-prods .swiper-container', {
  speed: 1000,
  autoplay: false,
  // autoplay: {
  //   delay: 1000,
  //   disableOnInteraction: false,
  // },
  loop: false,
  watchOverflow: true,
  slidesPerView: 3,
  // slidesPerColumn: 2,
  spaceBetween: 30,
  pagination: {
    el: '.feature-prods .swiper-pagination',
    clickable: true,
  },
  navigation: {
    nextEl: '.feature-prods .swiper-button-next',
    prevEl: '.feature-prods .swiper-button-prev',
  },
  breakpoints: {
    1024: {  //当屏幕宽度大于等于768 
      slidesPerView: 2,
      spaceBetween: 10,
    },
    768: {  //当屏幕宽度大于等于768 
      slidesPerView: 2,
      spaceBetween: 10,
    },

  }
});


// 新闻资讯

var newsSwiper = new Swiper('.news-fl .swiper-container', {
  speed: 1000,
  autoplay: false,
  loop: false,
  watchOverflow: true,
  spaceBetween: 20,
  navigation: {
    nextEl: '.news-fl .swiper-button-next',
    prevEl: '.news-fl .swiper-button-prev',
  },

});



var teamSwiper = new Swiper('.index-team-con .swiper-container', {
  speed: 1000,
  autoplay: false,
  // autoplay: {
  //   delay: 1000,
  //   disableOnInteraction: false,
  // },
  loop: false,
  watchOverflow: true,
  slidesPerView: 3,
  // slidesPerColumn: 2,
  spaceBetween: 20,
  pagination: {
    el: '.index-team-con .swiper-pagination',
    clickable: true,
  },
  navigation: {
    nextEl: '.index-team-con .swiper-button-next',
    prevEl: '.index-team-con .swiper-button-prev',
  },
  breakpoints: {
    1024: {  //当屏幕宽度大于等于768 
      slidesPerView: 2,
      spaceBetween: 10,
    },
    768: {  //当屏幕宽度大于等于768 
      slidesPerView: 1,
      spaceBetween: 10,
    },

  }
});


// 合作伙伴

var partnerSwiper = new Swiper('.partner-wrap .swiper-container', {
  speed: 500,
  autoplay: false,
  // autoplay: {
  //   delay: 1000,
  //   disableOnInteraction: false,
  // },
  loop: false,
  watchOverflow: true,
  slidesPerView: 6,
  slidesPerColumn: 3,
  spaceBetween: 20,
  pagination: {
    el: '.partner-wrap .swiper-pagination',
    clickable: true,
  },
  breakpoints: {
    1024: {  //当屏幕宽度大于等于768 
      slidesPerView: 2,
      spaceBetween: 10,
      slidesPerView: 4,
    },
    768: {  //当屏幕宽度大于等于768 
      slidesPerView: 1,
      slidesPerView: 2,
      spaceBetween: 10,
      pagination: {
        el: '.partner-wrap .swiper-pagination',
        clickable: true,
      },
    },

  }
});


// 案例切换

$(".index-case .item").eq(0).addClass('active')
$(".index-case-tabs>a").click(function () {
  $(this).addClass("active").siblings().removeClass("active");
  var index = $(this).index();
  $(".index-case .item").eq(index).addClass('active').siblings().removeClass('active')
});




// team弹窗
$(".team-con").on("click", function () {
  $(".team-popup").find(".t-content").html("");
  var content = $(this).find(".tbox").html();
  var inner = $(".team-popup").find(".t-content");
  inner.html(content);
  $(".mask").fadeIn(300);
  $(".team-popup").addClass("active");


})

$(".team-popup .closeBtn").on("click", function () {
  $(".team-popup").removeClass("active");
  $(".mask").fadeOut(300);

})

//phone-nav
$(".menuBtn").click(function () {
  $('body').toggleClass('fixme');
  $(".mask").fadeToggle(300);
  $(" .header nav").toggleClass("active");
});


$(".mask").click(function () {
  $('body').removeClass('fixme');
  $(".mask").fadeOut(300);
  $(" .header nav").removeClass("active");

  $(".team-popup").removeClass('active')


});
